/*
 * Steuerung.h
 *
 * Created: 10.02.2014 09:47:13
 *  Author: Peter
 */ 


#ifndef STEUERUNG_H_
#define STEUERUNG_H_


/********Global******************/
#define F_CPU 12000000UL
#include <avr/io.h>
#include <util/delay.h>
#include "i2c_master.h"
#include <stdio.h>
#include <string.h>
#include <avr/interrupt.h>


/*********BMP085******************/

// Adressen von I2C-Bausteinen
#define DevEAT123A	 0x74 // LCD EAT123A,	(0 1 1 1 0  1 SA0 R/W)
#define BMP085_WRITE 0xEE
#define BMP085_READ  0xEF
#define OSS			 0
#define TOUTH        0x02
#define BOTH         0x12

extern void bmp085_Calibration(void);
extern short bmp085_ReadCal(unsigned char address);
extern long  bmp085_ReadTemp(void);
extern long  bmp085_ReadPres(void);
extern void  bmp085_Convert(long * temperature, long * pressure);
extern int display_outstring(char *outtext);
extern void bmp085_get_altitude(void);

char temp_string[12];
char press_string[12];
char alt_string[12];
unsigned int result;
float wert;
short ac1;
short ac2;
short ac3;
unsigned short ac4;
unsigned short ac5;
unsigned short ac6;
short b1;
short b2;
short mb;
short mc;
short md;

char outstring_ac1[12], outstring_ac2[12], outstring_ac3[12], outstring_ac4[12],
outstring_ac4[12], outstring_ac5[12], outstring_ac6[12], outstring_b1[12],
outstring_b2[12], outstring_mb[12], outstring_mc[12], outstring_md[12];

long temperature;
long pressure;
long altitude;
double temp;

/***********CMPS10*****************/


#define CMPS10Write 0xC0	// CMPS10 Kompass R/W Bit nicht gesetzt
#define CMPS10Read	0xC1	// CMPS10 Kompass R/W Bit gesetzt

extern unsigned char cmps10_read_bearing_byte(void);
extern double cmps10_read_bearing_double(void);


/*********GPS******************/
	
extern void getgps();			//Schreibt in die Vorhandenen Arrys die GPS-Daten
extern void gpsinit();			//Initialisiert das GPS (Arrays erzeugen, Interrupts aktiveren, Uart initialisieren

int d;
int i;
double latitude_dec;
double longitude_dec;
double sealevel_dec;
int numberofsatellites_dec;
int quality_dec;


char data[120];
char time[9];
char latitude[9];
char longitude[11];
char quality;
char numberofsatellites[2];
char precision[4];
char sealevel[10];
char height[5];

/*********GSM******************/

extern void uart_init();			//Initialisiert den Usart mit einer Baud von 9600
extern void uart_putc(unsigned char c);
extern void uart_puts(char* s);



#endif /* STEUERUNG_H_ */